#ifndef NEOCALENDARPRIVATE_H
#define NEOCALENDARPRIVATE_H

#include "def.h"
#include <QColor>
#include <QDate>
#include <QModelIndex>

class NeoCalendarMask;
class QPropertyAnimation;
class NeoPushButton;
class NeoCalendarHeaderModel;
class NeoCalendarHeaderDelegate;
class NeoCalendar;
class NeoBaseListView;
class NeoCalendarDelegate;
class NeoCalendarModel;
class NeoCalendarPrivate : public QObject
{
    Q_OBJECT
    NEO_PRIVATE_CREATE(NeoCalendar)
    NEO_PROPERTY_CREATE(int, ViewOpacity)
    NEO_PRIVATE_PROPERTY_CREATE_H(QColor, BackgroundColor)
    NEO_PRIVATE_PROPERTY_CREATE_H(QColor, ToDayItemColor)
    NEO_PRIVATE_PROPERTY_CREATE_H(QColor, ItemHoverColor)
    NEO_PRIVATE_PROPERTY_CREATE_H(QColor, ItemSelectedColor)
    NEO_PRIVATE_PROPERTY_CREATE_H(QColor, ItemSelectedBorderColor)
public:
    NeoCalendarPrivate(QObject *parent = nullptr);
    ~NeoCalendarPrivate();

    void scrollToDate(const QDate &date = QDate::currentDate(), bool isAnimation = true);
    void changeDisplayMode(NeoCalendarType::DisplayMode mode);
    void updateCenterIndex();

private slots:
    void onTitleButtonClicked();
    void onPrevButtonClicked();
    void onNextButtonClicked();
    void onDateIndexClicked(const QModelIndex &index);

private:
    NeoPushButton *pTitleButton;
    NeoPushButton *pPrevButton;
    NeoPushButton *pNextButton;
    NeoBaseListView *pHeaderView;
    NeoBaseListView *pCalendarView;
    NeoCalendarHeaderModel *pHeaderModel;
    NeoCalendarHeaderDelegate *pHeaderDelegate;
    NeoCalendarModel *pCalendarModel;
    NeoCalendarDelegate *pCalendarDelegate;
    NeoCalendarMask *pCalendarMask;

    QPropertyAnimation *pDisplayModeAnimation;
    QModelIndex pCenterIndex;
    NeoCalendarType::DisplayMode pDisplayMode;
};

#endif